<?php
/*
$Id$

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright (c) 2007 osCommerce

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License v2 (1991)
as published by the Free Software Foundation.
*/
?>
<style type="text/css"><!--
	.dataDashboard THEAD TH
	{
		padding: 3px 10px;
		border-bottom: 1px solid #333;
		font-weight: bold;
	}
	.dataDashboard TBODY TD
	{
		padding: 3px 10px;
	}
	.dataDashboard TR.mouseOver TD, .dataDashboard TR.mouseOverDeactivatedRow TD
	{
		background-color: #B9DCFF;
	}
	.dataDashboard TR.deactivatedRow TD
	{
		background-color: #FFC896;
	}
	//-->
</style>
<?php

	$osC_DirectoryListing = new osC_DirectoryListing('includes/modules/summary');
	$osC_DirectoryListing->setIncludeDirectories(false);
	$files = $osC_DirectoryListing->getFiles();

	$Qonline = $osC_Database->query('select count(*) as total from :table_whos_online where time_last_click >= :time_last_click');
	$Qonline->bindTable(':table_whos_online', TABLE_WHOS_ONLINE);
	$Qonline->bindInt(':time_last_click', (time() - 900));
	$Qonline->execute();
?>

<p><?php echo osc_link_object(osc_href_link_admin(FILENAME_DEFAULT, 'whos_online'), osc_icon('people.png') . '&nbsp;' . sprintf($osC_Language->get('total_customers_online'), $Qonline->valueInt('total'))); ?></p>

<table border="0" width="100%" cellspacing="0" cellpadding="2">
	<tr>
		<td rowspan="4" width="50%" valign="top"><br>
			<?php require 'external/fullcalendar/index.php'; ?>
			<body>
				<div id="calendar"></div>
				<div id="dialog-form" title="<?php echo $osC_Language->get('event') ?>">
					<p class="validateTips"></p>
					<form>
						<p><label for="event_type"><?php echo $osC_Language->get('event_type') ?></label>
						<input type="text" id="event_type" name="event_type" value=""></p>
						<p><label for="event_start"><?php echo $osC_Language->get('event_start') ?></label>
						<input type="text" name="event_start" id="event_start"/></p>
						<p><label for="event_end"><?php echo $osC_Language->get('event_end') ?></label>
						<input type="text" name="event_end" id="event_end"/></p>
						<input type="hidden" name="event_id" id="event_id" value="">
					</form>
				</div>
			</body>
		</td>

		<?php
			$col = 0;

			foreach ($files as $file) {
				if ($file['name'] == 'customers.php' or $file['name'] == 'orders.php' or $file['name'] == 'reviews.php'){
					include('includes/modules/summary/' . $file['name']);

					$module = substr($file['name'], 0, strrpos($file['name'], '.'));
					$module_class = 'osC_Summary_' . $module;

					$osC_Summary = new $module_class();

					if ($osC_Summary->hasData()) {
						echo '  <tr>' . "\n";
						echo '    <td width="50%" valign="top">' . "\n";

						if ($osC_Summary->hasTitleLink()) {
							echo '<a href="' . $osC_Summary->getTitleLink() . '">';
						}
						echo '<h1>' . $osC_Summary->getTitle() . '</h1>';

						if ($osC_Summary->hasTitleLink()) {
							echo '</a>';
						}
						echo $osC_Summary->getData();
						echo '    </td>' . "\n";
						echo '  </tr>' . "\n";
					}
					unset($osC_Summary);
				}
			}
		?>
	</tr>
</table>